//
//  LYDevelopKit+Foundation.h
//  LYDevelopKit
//
//  Created by 李阳 on 2018/5/25.
//

#ifndef LYDevelopKit_Foundation_h
#define LYDevelopKit_Foundation_h

#import "NSString+LYAdd.h"
#import "NSArray+LYAdd.h"
#import "NSTimer+LYAdd.h"
#import "NSObject+LYAdd.h"
#import "NSDate+LYAdd.h"


#ifndef dispatch_queue_async_safe
#define dispatch_queue_async_safe(queue, block)\
    if (dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL) == dispatch_queue_get_label(queue)) {\
        block();\
    } else {\
        dispatch_async(queue, block);\
    }
#endif

#ifndef dispatch_main_async_safe
#define dispatch_main_async_safe(block) dispatch_queue_async_safe(dispatch_get_main_queue(), block)
#endif


/// 生成范围随机数 [min, max]
static inline NSInteger LYRandomInRange(NSInteger min, NSInteger max)
{
    return (NSInteger)(min + (arc4random() % (max - min + 1)));
}




#endif /* Header_h */
